<template>
	<div>
		<div class="imgWarp" style="margin-top: 0;">
			<img :src="srcImg" alt="">
		</div>
		<!-- <div class="weui-gallery" style="display: none">
			<span class="weui-gallery__img">
				<img src="" style="width: 100%;height: auto;margin-top: 50%" />
			</span>
		</div> -->
		<div class="demos-content-padded" style="padding: 0.3rem 1.1rem;" v-if='status!=1'>
			<a href="javascript:;" class="weui-btn weui-btn_primary" @click="clickBtn">已收到收货单</a>
		</div>
	</div>
</template>

<script>
	import { getStorePic,confirmInStore } from '../../config/api'
	import { imgBaseUrl } from '../../config/axios'
	import { Toast } from 'we-vue'
	export default {
		data() {
			return {
				status:this.$route.query.status,
				orderNo:this.$route.query.orderNo,
				srcImg:''
			}
		},
		mounted(){
			getStorePic(this.orderNo).then(res=>{
				if(res.code==100){
					this.srcImg = imgBaseUrl + res.content
				}else{
					Toast.fail('暂无数据');
				}
			})
		},
		methods: {
			clickBtn() {
				confirmInStore(this.orderNo).then(res=>{
					if(res.code==100){
						Toast.success({
								duration:1200,
								message:res.content
							})
							setTimeout(()=>{
									this.$router.push('/mine')
								}, 1200)
						}else{
							Toast.fail(res.content)
						}
				})
			}
		}
	}
</script>

<style>
</style>
